home *** CD-ROM | disk | FTP | other *** search
/ Adobe Graphics & Publishing SDK 1996 December / Adobe Graphics & Publishing SDK 1996 December.iso / mac / PageMaker 6.5 SDK Mac / SourceCode / Includes / CIKnowledgeBase.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-11-18  |  2.2 KB  |  74 lines  |  [TEXT/CWIE]

  1. /***[f*****************************************************************
  2.  *    CIkb.h    -- Knowledge base Interface. 
  3.  *
  4.  *    Copyright 1996 (c) Adobe Systems, Inc. All Rights Reserved
  5.  *
  6.  *    Public version
  7.  *    
  8.  * $Revision:   1.1  $
  9.  *
  10.  ****f]*****************************************************************/
  11. #ifndef __CIKB
  12. #define __CIKB
  13. #include "pmtypes.h"
  14.  
  15. // conventions for using following templatedatarec structure:
  16. //
  17. // To be used in an array, where each entry is as follows:
  18. //         First entry:      template name, # of field slots that follow
  19. //        Second entry:    id field name, id field value 
  20. //                        If id field name == NULL, use next fact of template
  21. //                        This ID only for getting.... for setting, just a normal field
  22. //        Third, etc.:    field name, field value
  23. // 
  24.  
  25. typedef struct _templatedatarec {
  26.     char aname[32];
  27.     int     avalue;
  28. } templatedatarec, FAR *lptemplatedatarec;
  29.  
  30.  
  31.  
  32. class CIkb;    // forward declaration
  33.  
  34. //    THE "RULEABLE" CLASS
  35. //
  36. //    This class describes a protocol for an object to
  37. //    link itself to a rulebase, by providing a method
  38. //    that encapsulates the knowledge of the specific
  39. //    fact-name in the rulebase that corresponds to each
  40. //    member data having a fact.  Using multiple inheritance,
  41. //    the page, column, and textblock objects inherit from
  42. //    this 'ruleable' since they have facts to relate to.
  43. //
  44. class ruleable : public CIInterface {
  45.  
  46.     public:
  47.         virtual int getfacts(const CIkb& theKB) = 0;
  48.         virtual int setfacts(const CIkb& theKB) = 0;
  49.     private:
  50.  
  51. };
  52. /////////////////////////////////////////////////////////////////
  53. //        END OF RULEABLE CLASS
  54. /////////////////////////////////////////////////////////////////
  55.  
  56. class CIkb : public CIInterface  {
  57.     public:
  58.         // General running of the rulebase
  59.         virtual int clear() = 0;
  60.            virtual PMXErr solve(ruleable *object, char *filename) = 0;
  61.  
  62.         // Fact management methods
  63.         virtual int getIntFact(char *fname, int *val) const = 0;
  64.         virtual int setIntFact(char *fname, int val) const = 0;
  65.         virtual int setTemplateFact(lptemplatedatarec lpTDR) const = 0;
  66.         virtual int getTemplateFact(lptemplatedatarec lpTDR) const = 0;
  67.  
  68.     private:
  69. };
  70.  
  71.  
  72.  
  73. #endif    // __CIKB
  74.